package com.company.cloud.tag.modules.api.fallback;

import java.util.List;
import java.util.Map;
import java.util.Set;

import com.company.cloud.common.bean.BaseClientResult;
import org.springframework.stereotype.Component;

import com.company.cloud.tag.modules.api.response.Label;
import com.company.cloud.tag.modules.api.response.LabelType;
import com.company.cloud.tag.modules.api.service.LabelRemoteService;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;

@Log4j2
@Component
public class LabelRemoteServiceFallbackFactory implements FallbackFactory<LabelRemoteService>{

	@Override
	public LabelRemoteService create(Throwable cause) {
		return new LabelRemoteService() {
			
			@Override
			public BaseClientResult<Map<String, LabelType>> getLabelTypeMapByIds(String ids) {
				log.debug("获取标签分类Map异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
			
			@Override
			public BaseClientResult<Map<String, LabelType>> getLabelTypeMapByIds(Set<String> ids) {
				log.debug("获取标签分类Map异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
			
			@Override
			public BaseClientResult<List<LabelType>> getLabelTypeListByIds(String ids) {
				log.debug("获取标签分类List异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
			
			@Override
			public BaseClientResult<List<LabelType>> getLabelTypeListByIds(Set<String> ids) {
				log.debug("获取标签分类List异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
			
			@Override
			public BaseClientResult<Map<String, Label>> getLabelMapByIds(String ids) {
				log.debug("获取标签Map异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
			
			@Override
			public BaseClientResult<Map<String, Label>> getLabelMapByIds(Set<String> ids) {
				log.debug("获取标签Map异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
			
			@Override
			public BaseClientResult<List<Label>> getLabelListByIds(String ids) {
				log.debug("获取标签List异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
			
			@Override
			public BaseClientResult<List<Label>> getLabelListByIds(Set<String> ids) {
				log.debug("获取标签List异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<List<Label>> test(Set<String> ids) {
				log.debug("+++++标签测试异常,ids={}", ids);
				return BaseClientResult.callbackError();
			}
		};
	}

}
